|
dcmotor32 2.2.0
|
API for configuring and manipulating DC Motor 32 Click driver. More...
Topics | |
| DC Motor 32 Settings | |
| Settings of DC Motor 32 Click driver. | |
| DC Motor 32 MikroBUS Map | |
| MikroBUS pin mapping of DC Motor 32 Click driver. | |
Functions | |
| void | dcmotor32_cfg_setup (dcmotor32_cfg_t *cfg) |
| DC Motor 32 configuration object setup function. | |
| err_t | dcmotor32_init (dcmotor32_t *ctx, dcmotor32_cfg_t *cfg) |
| DC Motor 32 initialization function. | |
| err_t | dcmotor32_default_cfg (dcmotor32_t *ctx) |
| DC Motor 32 default configuration function. | |
| err_t | dcmotor32_set_control (dcmotor32_t *ctx, uint8_t control) |
| DC Motor 32 set control function. | |
| err_t | dcmotor32_get_status (dcmotor32_t *ctx) |
| DC Motor 32 get status function. | |
| err_t | dcmotor32_set_operation_mode (dcmotor32_t *ctx, uint8_t mode) |
| DC Motor 32 set operation mode function. | |
| err_t | dcmotor32_enable_isense (dcmotor32_t *ctx) |
| DC Motor 32 enable current sense function. | |
| err_t | dcmotor32_disable_isense (dcmotor32_t *ctx) |
| DC Motor 32 disable current sense function. | |
| err_t | dcmotor32_set_fast_slew_rate (dcmotor32_t *ctx) |
| DC Motor 32 set fast slew rate function. | |
| err_t | dcmotor32_set_slow_slew_rate (dcmotor32_t *ctx) |
| DC Motor 32 set slow slew rate function. | |
| err_t | dcmotor32_enable_device (dcmotor32_t *ctx) |
| DC Motor 32 enable device function. | |
| err_t | dcmotor32_disable_device (dcmotor32_t *ctx) |
| DC Motor 32 disable device function. | |
| err_t | dcmotor32_read_adc_raw (dcmotor32_t *ctx, uint16_t *data_out) |
| DC Motor 32 read raw IS ADC value function. | |
| err_t | dcmotor32_read_adc_volt (dcmotor32_t *ctx, float *data_out) |
| DC Motor 32 read IS pin voltage level function. | |
| err_t | dcmotor32_read_adc_volt_avg (dcmotor32_t *ctx, uint16_t num_conv, float *volt_avg) |
| DC Motor 32 read IS pin voltage level average function. | |
| err_t | dcmotor32_set_adc_vref (dcmotor32_t *ctx, float vref) |
| DC Motor 32 set vref function. | |
| err_t | dcmotor32_calib_offset (dcmotor32_t *ctx) |
| DC Motor 32 calibrate offset function. | |
| err_t | dcmotor32_get_out_current (dcmotor32_t *ctx, float *current) |
| DC Motor 32 get output current function. | |
API for configuring and manipulating DC Motor 32 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| err_t dcmotor32_calib_offset | ( | dcmotor32_t * | ctx | ) |
DC Motor 32 calibrate offset function.
This function measures and stores the zero current offset voltage.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void dcmotor32_cfg_setup | ( | dcmotor32_cfg_t * | cfg | ) |
DC Motor 32 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See dcmotor32_cfg_t object definition for detailed explanation. |
| err_t dcmotor32_default_cfg | ( | dcmotor32_t * | ctx | ) |
DC Motor 32 default configuration function.
This function executes a default configuration of DC Motor 32 Click board.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_disable_device | ( | dcmotor32_t * | ctx | ) |
DC Motor 32 disable device function.
This function disables the device.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_disable_isense | ( | dcmotor32_t * | ctx | ) |
DC Motor 32 disable current sense function.
This function disables the current sense function.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_enable_device | ( | dcmotor32_t * | ctx | ) |
DC Motor 32 enable device function.
This function enables the device.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_enable_isense | ( | dcmotor32_t * | ctx | ) |
DC Motor 32 enable current sense function.
This function enables the current sense function.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_get_out_current | ( | dcmotor32_t * | ctx, |
| float * | current ) |
DC Motor 32 get output current function.
This function calculates the output current from the measured ADC voltage.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
| [out] | current | : Pointer to the memory location where the output current will be stored. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_get_status | ( | dcmotor32_t * | ctx | ) |
DC Motor 32 get status function.
This function reads the device status byte using SPI communication.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_init | ( | dcmotor32_t * | ctx, |
| dcmotor32_cfg_t * | cfg ) |
DC Motor 32 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See dcmotor32_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_read_adc_raw | ( | dcmotor32_t * | ctx, |
| uint16_t * | data_out ) |
DC Motor 32 read raw IS ADC value function.
This function reads results of AD conversion of the IS pin.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
| [out] | data_out | : Output ADC result. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_read_adc_volt | ( | dcmotor32_t * | ctx, |
| float * | data_out ) |
DC Motor 32 read IS pin voltage level function.
This function reads results of AD conversion of the IS pin and converts them to proportional voltage level.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
| [out] | data_out | : Output voltage level of the analog pin [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_read_adc_volt_avg | ( | dcmotor32_t * | ctx, |
| uint16_t | num_conv, | ||
| float * | volt_avg ) |
DC Motor 32 read IS pin voltage level average function.
This function a desired number of IS pin ADC voltage samples and averages it.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
| [in] | num_conv | : Number of ADC samples. |
| [out] | volt_avg | : Average output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_set_adc_vref | ( | dcmotor32_t * | ctx, |
| float | vref ) |
DC Motor 32 set vref function.
This function sets the ADC voltage reference for DC Motor 32 Click driver.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
| [in] | vref | : Reference voltage (volts). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_set_control | ( | dcmotor32_t * | ctx, |
| uint8_t | control ) |
DC Motor 32 set control function.
This function writes the control value and checks the returned control byte.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
| [in] | control | : Control register value. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_set_fast_slew_rate | ( | dcmotor32_t * | ctx | ) |
DC Motor 32 set fast slew rate function.
This function sets the output slew rate to fast mode.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_set_operation_mode | ( | dcmotor32_t * | ctx, |
| uint8_t | mode ) |
DC Motor 32 set operation mode function.
This function sets the selected device operation mode.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
| [in] | mode | : Operation mode value. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor32_set_slow_slew_rate | ( | dcmotor32_t * | ctx | ) |
DC Motor 32 set slow slew rate function.
This function sets the output slew rate to slow mode.
| [in] | ctx | : Click context object. See dcmotor32_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.